package cn.com.myshiro.service;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.com.myshiro.bean.Syspermission;
import cn.com.myshiro.dao.SyspermissionDao;

@Service
public class SyspermissionService {

	@Autowired
	SyspermissionDao dao;

	public List<Syspermission> allSyspermission(Map<Object, Object> map) {
		return dao.allSyspermission(map);
	}

	public void delSyspermission(int id) {
		dao.delSyspermission(id);
	}

	public Syspermission syspermission(int id) {
		return dao.syspermission(id);
	}

	public void updateSyspermission(Syspermission syspermission) {
		dao.updateSyspermission(syspermission);
	}

	public void addSyspermission(Syspermission syspermission) {
		dao.addSyspermission(syspermission);
	}

	public int countSyspermission() {
		return dao.countSyspermission();
	}

	// 根据用户id查询权限范围的菜单
	public List<Syspermission> findMenuListByUserId(String id) {
		return dao.findMenuListByUserId(id);

	}

	// 根据用户id查询权限范围的url
	public List<Syspermission> findPermissionListByUserId(String id) {
		return dao.findPermissionListByUserId(id);

	}
}
